package com.rpay.service.config;

/**
 * Title：
 * Description
 *
 * @author fxg06 on 2018/4/19
 * @version 1.0
 */
public class ServiceThreadLocal {
    private static final ThreadLocal<String> ACCESS_TOKEN = new ThreadLocal<>();
    private static final ThreadLocal<Integer> USER_ID = new ThreadLocal<>();

    public static String getAccessToken() {
        return ACCESS_TOKEN.get();
    }

    public static void setAccessToken(String accessToken){
        ACCESS_TOKEN.set(accessToken);
    }

    public static void removeAccessToken() {
        ACCESS_TOKEN.remove();
    }

    public static Integer getUserId() {
        return USER_ID.get();
    }

    public static void setUserId(Integer userId){
        USER_ID.set(userId);
    }

    public static void removeUserId() {
        USER_ID.remove();
    }
}
